<!-- "script/apps/Aries/Creator/Game/NplBrowser/NplBrowserFrame.html" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<pe:mcml>
    <script type="text/npl" refresh="false">
        <![CDATA[
        local NplBrowserManager = NPL.load("(gl)script/apps/Aries/Creator/Game/NplBrowser/NplBrowserManager.lua");
        local page_ctrl = document:GetPageCtrl();
        local name = page_ctrl:GetRequestParam("name");
        local browser_page = NplBrowserManager:CreateOrGet(name);
        
        function OnClose()
            browser_page:Close();
        end
        function GetTitle()
            return browser_page:GetTitle();
        end
        function GetUrl()
            return browser_page:GetUrl();
        end
        function IsShowControl()
            return browser_page:IsShowControl();
        end
        function CanClose()
            return browser_page:CanClose();
        end
        function GetBrowserName()
            return browser_page:GetBrowserName();
        end
        function GetCloseBtnTitle()
            if(browser_page.options)then
                return browser_page.options.closeBtnTitle;
            end
            return "X";
        end
        ]]>
    </script>
    <div width="100%" height="100%" style="background-color:#000000;">
        <div style="height:30px;">
            <div style="position:relative;margin-left:5px;margin-top:2px;color:#ffffff;"><%=GetTitle()%></div>
            <pe:if condition='<%= CanClose() %>'>
                <pe:if condition='<%= GetCloseBtnTitle() == "X" %>'>
                    <input type="button" value="X" align="right" style="width:50px;height:30px;" onclick="OnClose()" class="mc_light_grey_button_with_fillet" />
                </pe:if>
                <pe:if condition='<%= GetCloseBtnTitle() ~= "X" %>'>
                    <input type="button" value='<%= GetCloseBtnTitle()%>' align="right" style="width:80px;height:30px;" onclick="OnClose()" class="mc_light_grey_button_with_fillet" />
                </pe:if>
            </pe:if>
        </div>
        <pe:container width="100%" height="100%">
            <pe:nplbrowser name='<%= GetBrowserName() %>' withControl="<%=IsShowControl()%>" enabledResize="true"  url="<%=GetUrl()%>" />
        </pe:container>
    </div>
</html>

